package com.login_php.initialization;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.apache.log4j.Logger;
import org.apache.torque.Torque;
import org.apache.torque.TorqueException;
	

public class MyServletContextListener implements ServletContextListener {

	  private static final Logger LOG = Logger.getLogger(MyServletContextListener.class);

	@Override
	  public void contextDestroyed(ServletContextEvent event) {

	  }

	  @Override
	  public void contextInitialized(ServletContextEvent event) {
		  try {
			  Torque.init("torque.properties");
		  } catch (TorqueException e) {
			  LOG.error("Ocorreu um erro ao inicializar a aplicação", e);
		  }
		  
		  System.out.println("\n\n\n");
		  System.out.println("SYSTEM INITIALIZED WITH SUCCESS!! \\o\\\\o//o/ \n\n\n");
	  }

}